#ifndef DEF_GRAPH
#define DEF_GRAPH

#include <list>
#include <vector>
#include <iostream>
#include <fstream>

#include "Node.h"

using namespace std;
using std::iostream;
using std::ifstream;
using std::ofstream;

typedef list<Node *> NodeList;

typedef vector<NodeList *>::iterator lnodelist_it;
typedef NodeList::iterator nodelist_it;

class Graph {
private:
    vector<NodeList *> *adjacency_list;

public:
    /* ----------------------------------------------------- */
    Graph();
    Graph(int n, double p);
    Graph(string graph_file_path);
    Graph(int n, double p, int k_color);
    ~Graph();

    /* ----------------------------------------------------- */

    vector<NodeList *> * getAdjacencyList();

    Graph * clone();
    int size();
    int vertice_nb();
    friend ostream & operator<<(ostream&, const Graph &g);

    /* ----------------------------------------------------- */
    void saveOnFile(string graph_file_path);
    void saveOnDotFile(string dot_file_path);
    void saveOnCnfFile(string cnf_file_path, int k);
};



#endif
